package hu;

import java.util.*;

/**
 * 变相的背包问题，其实递归更加合适，背包老出错
 */
public class hu93 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] num = new int[n];
        List<Integer> list = new ArrayList<>();
        int sum3 = 0;
        int sum5 = 0;
        int sum = 0;
        for (int i = 0; i < n; i++) {
            num[i] = sc.nextInt();
            if (num[i] % 3 == 0 && num[i] % 5 != 0)
                sum3 += num[i];
            else if (num[i] % 5 == 0)
                sum5 += num[i];
            else
                list.add(num[i]);
            sum += num[i];
        }
        if(sum % 2 != 0){
            System.out.println(false);
            return;
        }
        int tar = sum / 2 - sum3;
        System.out.println(dfs(list, tar, 0));
    }
    public static boolean dfs(List<Integer> list, int tar, int start) {
        if(start == list.size())
            return tar == 0;
        return dfs(list, tar - list.get(start), start + 1) || dfs(list, tar, start + 1);
    }
}
